package car;

public class Bus extends Vehicle {


    public Bus(String vehicleId, String brand, String type, int perRent) {
        this.setVehicleId(vehicleId);
        this.setBrand(brand);
        this.setType(type);
        this.setPerRent(perRent);
    }

    //计算租金
    public float calRent(int days) {
        float money;
        if (days >= 3 && days < 7) {
            money = (float) (days * getPerRent() * 0.9);
        } else if (days >= 7 && days < 30) {
            money = (float) (days * getPerRent() * 0.8);
        } else if (days >= 30 && days < 150) {
            money = (float) (days * getPerRent() * 0.7);
        } else if (days >= 150) {
            money = (float) (days * getPerRent() * 0.6);
        } else {
            return (float) (days * getPerRent());
        }
        return money;
    }
}
